/*
 * TOSEExplorer.h
 *
 * This file is a part of TermOSEmulator.
 *
 * Written by Peter Winchester <wincsoft_pw@outlook.com>
 * Copyright (C) 2021 Peter Winchester.
 *
 * TermOSEmulator is free software, follows the GNU General
 * Public License.
 *
 * NOTE: TermOSEmulator requires Windows API, so it can only
 * run on the Windows.
 *
 */

#ifndef TOSE_EXPLORER_H
#define TOSE_EXPLORER_H

#include "TermOSEmulator.h"

class TOSEFile //文件类型
{
public:
    string name, type;

    TOSEFile();
};

class Directory //目录类型
{
public:
    string name;                  //目录名称
    Directory *dirFather;         //父级目录
    vector<Directory *> dirChild; //子目录列表
    vector<TOSEFile> file;        //文件列表

    Directory();
    ~Directory();
};

extern Directory *dirRoot;     //根目录
extern Directory *dirCrt;      //当前目录
extern vector<string> pathCrt; //当前目录完整路径

int createNewDir(string);
int createNewFile(string, string);
int removeFile(string, string);
int goToDir(string);
int delDir(string);
int initExplorer();
void updateExplorer();
void writeExplorerData(Directory *);

#endif //TOSE_EXPLORER_H
